package com.gitee.swsk33.springxmlbased;

import com.gitee.swsk33.logcoredemo.service.LogService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

	public static void main(String[] args) {
		// 加载XML文件并创建IoC容器
		ApplicationContext context = new ClassPathXmlApplicationContext("/beans.xml");
		// 取出外部库中的功能类并调用
		LogService logService = context.getBean("logService", LogService.class);
		logService.info("调用日志服务！");
		logService.warn("调用日志服务！");
	}

}